load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "txnwait",
    srcs = [
        "metrics.go",
        "queue.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/txnwait",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/concurrency/isolation",
        "//pkg/kv/kvserver/concurrency/lock",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/roachpb",
        "//pkg/storage/enginepb",
        "//pkg/util/envutil",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/retry",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
    ],
)

go_test(
    name = "txnwait_test",
    size = "small",
    srcs = ["queue_test.go"],
    embed = [":txnwait"],
    deps = [
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/concurrency/isolation",
        "//pkg/kv/kvserver/concurrency/lock",
        "//pkg/roachpb",
        "//pkg/storage/enginepb",
        "//pkg/testutils",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "@com_github_stretchr_testify//require",
    ],
)
